package com.pzh.assignment.common.bean.vo;

import com.pzh.assignment.entity.TaskFinal;
import lombok.Data;

@Data
public class TaskFinalVO {
    private Integer id;
    private Float credit;
    private String teacherName;
    private String merge;
    private Float experimental;
    private Float theoretical;
    private Integer actualNum;
    private String major;
    private String courseName;
    private String courseType;
    private Integer grade;
    private String semester;

    public static TaskFinalVO valueOf(TaskFinal taskFinal) {
        TaskFinalVO vo = new TaskFinalVO();
        vo.setId(taskFinal.getId());
        vo.setCredit(taskFinal.getCredit());
        vo.setTeacherName(taskFinal.getTeacher());
        vo.setMerge(taskFinal.getMerge() == 0 ? "合班" : "不合班");
        vo.setExperimental(taskFinal.getExperimental());
        vo.setTheoretical(taskFinal.getTheoretical());
        vo.setActualNum(taskFinal.getActualNum());
        vo.setMajor(taskFinal.getMajor());
        vo.setCourseName(taskFinal.getCourseName());
        vo.setCourseType(taskFinal.getCourseType());
        vo.setGrade(taskFinal.getGrade());
        vo.setSemester(taskFinal.getSemester());
        return vo;
    }

}
